﻿using System;
using Microsoft . VisualStudio . TestTools . UnitTesting;
using GameClassLibrary;
using System . Xml . Linq;
using System . Xml;
using System . Collections;
using System . Collections . Generic;

namespace GameUnitTest
{
    public class Tester : GameObject
    {


        [SaveValue]
        public int ValueTest { get; set; } = 5;

        [SaveReference]
        public Tester GameObjectReferenceTest { get; set; }

        [SaveValue]
        public Tester GameObjectValueTest { get; set; }

        [SaveValueList]
        public List<int> ValueListTest { get; set; } = new List<int> ( );

        [SaveValueList]
        public List<Tester> GameObjectValueListTest { get; set; } = new List<Tester> ( );

        public Tester ( XElement saving ) : base ( saving )
        {

        }

        public Tester ( ) : base ( )
        {

        }

        public override void NextDay ( )
        {
            throw new NotImplementedException ( );
        }
    }

    [TestClass]
    public class GameTest
    {
        [TestMethod]
        public void StartTest ( )
        {
           // var b = new Tester ( a . Save ( ) );
        }

        [TestMethod]
        public void SaveTest ( )
        {
            Game . listForLoad = new List<Tuple<GameObject , Type , string , long>> ( );

            var a = new Tester ( );
            a . GameObjectReferenceTest = new Tester { ValueTest = 6 };
            a . GameObjectValueTest = new Tester { ValueTest = 6 };

            a . ValueListTest . Add ( 1 );
            a . ValueListTest . Add ( 3 );
            a . ValueListTest . Add ( 2 );
            a . GameObjectValueListTest . Add ( new Tester { } );
            var c = a . Save ( );
        }
    }
}
